﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KeRui.Common;
using System.Collections.Generic;

public partial class Manage_Cms_PhoneValidateList : System.Web.UI.Page
{
    #region 定义相关变量
    protected KeRui.BLL.Seller bllSeller = new KeRui.BLL.Seller();
    protected KeRui.BLL.Validate bllValidate = new KeRui.BLL.Validate();
    protected KeRui.BLL.CmsComment bllComment = new KeRui.BLL.CmsComment();
    protected KeRui.Model.Seller modelSeller = new KeRui.Model.Seller();
    protected KeRui.Model.Validate modelValidate = new KeRui.Model.Validate();
    protected KeRui.Model.CmsComment modelComment = new KeRui.Model.CmsComment();

    protected int PageSize = 20;                               //每页数量
    protected int PageIndex = KeRui.Common.PageRequest.GetInt("page", 1);   //请求的页码
    protected int PageCS = KeRui.Common.PageRequest.GetInt("cs", -1);       //记录总数
    protected int PageCount = 0;                               //总页数
    protected string PageShow = "";                            //分页显示

    protected int ValidateID = PageRequest.GetInt("id", 0);
    protected int SenderID = 0;     //系统后台登录者ID
    protected int UserID = PageRequest.GetInt("uid", 0);   //UserID
    protected string UserName = PageRequest.GetString("uname"); //UserName
    protected List<String> phoneList = new List<string>();
    protected DataTable dt;
    #endregion

    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();//登陆判断

        SenderID = int.Parse(Request.Cookies["account"].Values["userid"].ToString());

        GetInfo();
    }

     #region 获取页面数据信息
    /// <summary>
    /// 获取页面数据信息
    /// </summary>
    private void GetInfo()
    {
        dt = bllValidate.GetList(PageSize, PageIndex, " 1=1 AND Type ='手机验证'", " State ASC,RequestTime DESC");
        if (dt == null)
        {
            dt = new DataTable();
        }
        else
        {
            //绑定认证手机号码
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string strPhone = bllSeller.GetModel(bllSeller.GetSellerIDByUserid(int.Parse(dt.Rows[i]["UserID"].ToString()))).Mobile;
                phoneList.Add(strPhone);
            }
        }

        //总数
        if (PageCS == -1)
            PageCS = bllValidate.GetCount(" 1=1 AND Type ='手机验证'");
        //总页数
        if (PageCS % PageSize == 0)
            PageCount = PageCS / PageSize;
        else
            PageCount = PageCS / PageSize + 1;
        //分页显示
        PageShow = ManageHelper.showSplitPage("PhoneValidateList.aspx?cs=" + PageCS.ToString() + "&page={0}", PageIndex, PageSize, PageCS);
    }
    #endregion
}
